package net.optix.ip.vo
{
	public class TradeSecretVO
	{
		public var tradeSecretID:int;
		public var clientID:int;
		public var inventionID:int;
		public var tradeSecret:String;
		public var infExtentOut:int;
		public var infExtentIn:int;
		public var infValue:int;
		public var infTime:int;
		public var infDiff:int;
		public var infSum:Number;
		public var infMeasures:int;
		
		public var strExtentOut:String;
		public var strExtentIn:String;
		public var strValue:String;
		public var strTime:String;
		public var strDiff:String;
		public var strMeasures:String;
		
		public static function purseSecret(value:XML):TradeSecretVO
		{
			var secret:TradeSecretVO	=	new TradeSecretVO();
			try
			{
				secret.tradeSecretID	=	value.TradeSecretID;
				secret.clientID			=	value.ClientID;
				secret.tradeSecret		=	value.TradeSecret;
				secret.infExtentOut		=	value.InfExtentOut;
				secret.infExtentIn		=	value.InfExtentIn;
				secret.infValue			=	value.InfValue;
				secret.infTime			=	value.InfTime;
				secret.infDiff			=	value.InfDiff;
				secret.infMeasures		=	value.InfMeasures;
				
				secret.infSum		=	secret.infExtentOut+secret.infExtentIn+
					secret.infMeasures+secret.infValue+secret.infTime+secret.infDiff;
					
				secret.infSum		=	Number((secret.infSum/30).toFixed(3));
				//secret.infSum.toFixed(2);
				secret.strExtentOut		=	value.StrExtentOut;
				secret.strExtentIn		=	value.StrExtentIn;
				secret.strValue			=	value.StrValue;
				secret.strTime			=	value.StrTime;
				secret.strDiff			=	value.StrDiff;
				secret.strMeasures		=	value.StrMeasures;
			}
			catch(error:Error){}
			return secret;
		}
	}
}